﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/pages/Menu.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="admin_pages_clientes_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Titulo" Runat="Server">
Cliente
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Pagina" Runat="Server">
    <div class="magin-auto cadastro">
        <fieldset>
            <legend><label>Lista de Clientes</label></legend>
                <div class="botao_top">
                    <asp:HyperLink ID="btnSalvar" runat="server"  CssClass="sem_borda texto_cinza" 
                                   NavigateUrl="~/admin/pages/clientes/Novo.aspx" >
                        <asp:Image ID="ImageButton2" runat="server"  CssClass="sem_borda"
                            ImageUrl="~/admin/Images/bt_add.png"
                             ToolTip="Novo" />
                        Novo
                    </asp:HyperLink>
                </div>
                <asp:GridView ID="GridViewCliente" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                    BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                    DataKeyNames="ID" DataSourceID="EntityDataSource1" 
                    onselectedindexchanged="SelectGrid"
                     GridLines="None" Width="100%">
                    <Columns>
                        <asp:BoundField DataField="Desc" HeaderText="Descrição" SortExpression="Desc" />
                        <asp:BoundField DataField="Url" HeaderText="Url" SortExpression="Url" />

                        <asp:TemplateField HeaderText="Imagem" SortExpression="Image">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%#  Bind("Image") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Image ID="Image3" runat="server" Width='55px' Height='55px' ImageUrl='<%# ResolveClientUrl("~/File/thumb/"+Eval("Image")) %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>

                                <asp:LinkButton ID="LinkButton1" runat="server" ToolTip="Editar" CausesValidation="False" 
                                    CommandName="Select"  >
                                    <asp:Image ID="Image1" runat="server" BorderWidth="0px" ImageUrl="~/admin/Images/iconEdit.png"/>
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                               
                                <asp:LinkButton ID="LinkButton2" runat="server" CssClass="sem_borda" CausesValidation="False" 
                                    CommandName='<%# Eval("ID") %>'
                                    OnCommand="Deletar" 
                                    OnClientClick='<%# Eval("ID", "return confirm(\"Deseja mesmo apagar o registro?\")") %>'>
                                     <asp:Image ID="Image2" runat="server"  BorderWidth="0px" ImageUrl="~/admin/Images/icon_excluir.png"/>
                                </asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                    <HeaderStyle CssClass="HeaderStyle" />
                    <PagerStyle CssClass="PagerStyle" HorizontalAlign="Center" />
                    <RowStyle CssClass="RowStyle" /> 
                    <EmptyDataRowStyle CssClass="EmptyRowStyle" />
                    <SelectedRowStyle CssClass="SelectedRowStyle" />
                    <EditRowStyle CssClass="EditRowStyle" />
                    <AlternatingRowStyle CssClass="AltRowStyle" />
                    <SortedAscendingCellStyle BackColor="#FEFCEB" />
                    <SortedAscendingHeaderStyle BackColor="#AF0101" />
                    <SortedDescendingCellStyle BackColor="#F6F0C0" />
                    <SortedDescendingHeaderStyle BackColor="#7E0000" />
                </asp:GridView>
                <div class="voltar">
                    <asp:LinkButton ID="lkVoltar" runat="server" CssClass="texto_cinza" PostBackUrl="~/admin/pages/clientes/Default.aspx">home</asp:LinkButton>
                </div>
            </fieldset>
        </div>
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=guedesEntities" DefaultContainerName="guedesEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="clients" EntityTypeFilter="clients">
    </asp:EntityDataSource>
</asp:Content>

